package org.mags.rema.model.provider;

import org.mags.dao.provider.AbstractProviderFactory;

public class EntityProviderFactory extends AbstractProviderFactory {
	private static final String ID = "entity";
	private EntityProvider entityProvider;
	private EntityRelationshipProvider entityRelationshipProvider;
	private EntityStructureProvider entityStructureProvider;
	private EntityTypeProvider entityTypeProvider;
	private EntityCategoryProvider entityCategoryProvider;
	private EntityStatusProvider entityStatusProvider;
	
	public EntityProviderFactory() {
		super(ID);
	}
	public EntityStatusProvider getEntityStatusProvider() {
		if(entityStatusProvider==null)
			entityStatusProvider = new EntityStatusProvider();
		entityStatusProvider.setDataContext(getDataContext());
		return entityStatusProvider;
	}
	public EntityCategoryProvider getEntityCategory() {
		if(entityCategoryProvider == null)
			entityCategoryProvider = new EntityCategoryProvider();
		entityCategoryProvider.setDataContext(getDataContext());
		return entityCategoryProvider;
	}
	public EntityProvider getEntityProvider() {
		if(entityProvider==null)
			entityProvider = new EntityProvider(this.getEntityTypeProvider());
		entityProvider.setDataContext(getDataContext());
		return entityProvider;
	}
	public EntityRelationshipProvider getEntityRelationshipProvider() {
		if(entityRelationshipProvider==null)
			entityRelationshipProvider = new EntityRelationshipProvider();
		entityRelationshipProvider.setDataContext(getDataContext());
		return entityRelationshipProvider;		
	}
	public EntityStructureProvider getEntityStructureProvider() {
		if(entityStructureProvider==null)
			entityStructureProvider = new EntityStructureProvider();
		entityStructureProvider.setDataContext(getDataContext());
		return entityStructureProvider;
	}
	public EntityTypeProvider getEntityTypeProvider() {
		if(entityTypeProvider==null)
			entityTypeProvider = new EntityTypeProvider();
		entityTypeProvider.setDataContext(getDataContext());
		return entityTypeProvider;
	}
	@Override
	public void refreshAll() {
	}	
}
